package com.zhong.learning.auto_paper.factory;

import com.our.learning.infrastructure.po.BlankQuestion;
import com.our.learning.infrastructure.po.ChoiceQuestion;
import com.our.learning.infrastructure.po.PictureQuestion;
import com.our.learning.infrastructure.po.Question;

/**
 * 题目工厂类，用于生产不同题型的题目
 * @author zhong
 * @date 2023/6/20
 */
public class QuestionFactory {
    public static Question createQuestion(String type) {
        Question question = null;
        if ("choice".equals(type)) {
            question = new ChoiceQuestion();
        } else if ("blank".equals(type)) {
            question = new BlankQuestion();
        } else if ("picture".equals(type)) {
            question = new PictureQuestion();
        }
        return question;
    }
}
